home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / libfpvm / pvmfreduce.m4 < prev    next >
Text File  |  1997-07-22  |  2KB  |  77 lines

  1.  
  2. /* $Id: pvmfreduce.m4,v 1.3 1997/05/08 15:58:49 pvmsrc Exp $ */
  3.  
  4. #include "pvm3.h"
  5. #include "pvm_consts.h"
  6.  
  7. void
  8. FUNCTION(pvmfreduce) ARGS(`func, data,count, datatype, msgtag, STRING_ARG(gname), rootinst, info')
  9. #ifdef IMA_UXPM
  10. void (**func)(); /* correction for Fujitsu FORTRAN77 EX */
  11. #else
  12. void (*func)();
  13. #endif
  14. void *data;
  15. int *count, *datatype, *msgtag, *rootinst, *info;
  16. STRING_ARG_DECL(gname);
  17. {
  18.   char tgroup[MAX_GRP_NAME + 1];
  19.  
  20.   /*
  21.    * Copy the group name to make sure there's a NUL at the end.
  22.    */
  23.   if (ftocstr(tgroup, sizeof(tgroup), STRING_PTR(gname), STRING_LEN(gname))){
  24.     *info = PvmBadParam;
  25.     return;
  26.     }
  27.  
  28. #ifdef IMA_UXPM
  29.   *info = pvm_reduce(*func, data, *count, *datatype, *msgtag, tgroup, 
  30.                      *rootinst);
  31. #else
  32.   *info = pvm_reduce(func, data, *count, *datatype, *msgtag, tgroup, 
  33.                      *rootinst);
  34. #endif
  35.  
  36. }
  37.  
  38. /* various reduction functions are defined here */
  39.  
  40. void
  41. FUNCTION(pvmmax) ARGS(`datatype, data, work, count, info')
  42. int *datatype;
  43. void *data, *work;
  44. int *count, *info;
  45. {
  46.   PvmMax(datatype, data, work, count, info);
  47. }
  48.  
  49.  
  50.  
  51. void
  52. FUNCTION(pvmmin) ARGS(`datatype, data, work, count, info')
  53. int *datatype;
  54. void *data, *work;
  55. int *count, *info;
  56. {
  57.   PvmMin(datatype, data, work, count, info);
  58. }
  59.  
  60. void
  61. FUNCTION(pvmsum) ARGS(`datatype, data, work, count, info')
  62. int *datatype;
  63. void *data, *work;
  64. int *count, *info;
  65. {
  66.   PvmSum(datatype, data, work, count, info);
  67. }
  68.  
  69. void
  70. FUNCTION(pvmproduct) ARGS(`datatype, data, work, count, info')
  71. int *datatype;
  72. void *data, *work;
  73. int *count, *info;
  74. {
  75.   PvmProduct(datatype, data, work, count, info);
  76. }
  77.